import { defineConfig } from 'dumi';
import { components } from './components';

const repo = 'rmc-kiana-mei';

export default defineConfig({
  title: repo,
  favicon:
    'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
  logo:
    'https://user-images.githubusercontent.com/9554297/83762004-a0761b00-a6a9-11ea-83b4-9c8ff721d4b8.png',
  outputPath: 'docs-dist',
  mode: 'site',
  hash: true,
  // Because of using GitHub Pages
  base: `/${repo}/`,
  publicPath: `/${repo}/`,
  sass: {
    implementation: require('node-sass'),
  },
  locales: [['zh', '中文']],
  scripts: [
    `
      if(location.pathname.includes('rmc-kiana-mei/~demos')) {
        document.querySelector('html').style.fontSize = '100px'
        document.body.style.background = '#f5f7fa'
      }
    `,
  ],
  navs: [
    null,
    {
      title: 'GitHub',
      path: 'https://gitee.com/yuguoguoguo/rmc-kiana-mei.git',
    },
  ],
  menus: {
    '/components': [
      {
        title: '基础',
        children: components.basic,
      },
      {
        title: '输入',
        children: components.dataEntry,
      },
      {
        title: '反馈',
        children: components.feedBack,
      },
      {
        title: '显示',
        children: components.manifest,
      },
      {
        title: '插件',
        children: components.plugin,
      },
    ],
  },
  // more config: https://d.umijs.org/config
});
